import java.util.*;
import java.util.Map.Entry;

public class _11_MostFrequentWord {
	
	public static void main(String[] args) {
		
		Scanner inputCS = new Scanner(System.in);
		String input = inputCS.nextLine();
		inputCS.close();
		
		String[] splittedText = input.split("\\W");
		List<String> list = new ArrayList<String>(Arrays.asList(splittedText));
		//list.removeAll(Arrays.asList("", null));
		list.removeAll(Collections.singleton(""));
		
		NavigableMap<String, Integer> wordsFrequencies = new TreeMap<String, Integer>();
		
		for (String word : list) {
			
			Integer freq = wordsFrequencies.get(word.toLowerCase());
			wordsFrequencies.put(word.toLowerCase(), (freq == null) ? 1 : freq + 1);
		}
		
		//String leastFrequent = (String) wordsFrequencies.keySet().toArray()[0];
		
		Entry<String, Integer> mostFrequent = wordsFrequencies.lastEntry();
		
		int value = mostFrequent.getValue();
		
		ArrayList<String> keys = new ArrayList<String>();
		
		for (Entry<String, Integer> entry : wordsFrequencies.entrySet()) {
			
			if (value == entry.getValue()) {
				
				keys.add(entry.getKey());
			}
		}
		
		for (String key : keys) {
			
			System.out.println(key + " -> " + value + " times");
		}
		
		System.out.println();
	}
}